fix(s2-docs): fix YAML frontmatter syntax errors and improve validation#700
Merged
fix(s2-docs): fix YAML frontmatter syntax errors and improve validation#700
Conversation
- Add js-yaml dependency to actually parse YAML and catch syntax errors - Fix improperly indented field names (related_components, parent_category) - Fix escaped underscores in field names - Update validation to catch YAML parsing errors before other checks - Fixed 86 markdown files with YAML frontmatter issues
|
Member
Author
Run report for 191fccf4Total time: 7.1ms | Comparison time: 0s | Estimated loss: 7.1ms (100.0% slower)
Touched files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After publishing docs/s2-docs to
main, GitHub displays YAML frontmatter errors on 86 markdown files. The error shown is:The root cause was that our YAML validation was incomplete - it only checked for specific formatting issues but never actually parsed the YAML to verify it was syntactically valid.
Changes
1. Enhanced YAML Validation
js-yamldependency totools/s2-docs-transformeryaml.load()2. Fixed YAML Frontmatter Issues
related_components:andparent_category:were indented as if they were part of list items, causing syntax errors\_instead of_3. Enhanced Fix Script
Files Fixed
docs/s2-docs/with YAML frontmatter issuesTesting
pnpm --filter @adobe/s2-docs-transformer testnow validates actual YAML parsingExample Fix
Before:
After: